// ERP系统路由配置
const erpRoutes = [
  {
    path: '/',
    name: 'Dashboard',
    component: () => import('@/views/dashboard/index.vue'),
    meta: { title: '首页', icon: 'home', perm: 'dashboard' }
  },
  {
    path: '/task',
    name: 'Task',
    meta: { title: '任务管理', icon: 'task', perm: 'task' },
    children: [
      {
        path: 'todo',
        name: 'TaskTodo',
        component: () => import('@/views/task/todo.vue'),
        meta: { title: '待办任务', perm: 'task:todo' }
      },
      {
        path: 'done',
        name: 'TaskDone',
        component: () => import('@/views/task/done.vue'),
        meta: { title: '已完成', perm: 'task:done' }
      },
      {
        path: 'assign',
        name: 'TaskAssign',
        component: () => import('@/views/task/assign.vue'),
        meta: { title: '任务分配', perm: 'task:assign' }
      },
      {
        path: 'design',
        name: 'TaskDesign',
        component: () => import('@/views/task/design.vue'),
        meta: { title: '任务设计', perm: 'task:design' }
      }
    ]
  },
  {
    path: '/customer',
    name: 'Customer',
    meta: { title: '客户管理', icon: 'customer', perm: 'customer' },
    children: [
      {
        path: 'list',
        name: 'CustomerList',
        component: () => import('@/views/customer/list.vue'),
        meta: { title: '客户列表', perm: 'customer:list' }
      }
    ]
  },
  {
    path: '/purchase',
    name: 'Purchase',
    meta: { title: '采购管理', icon: 'purchase', perm: 'purchase' },
    children: [
      {
        path: 'order',
        name: 'PurchaseOrder',
        component: () => import('@/views/purchase/order.vue'),
        meta: { title: '采购订单', perm: 'purchase:order' }
      },
      {
        path: 'in',
        name: 'PurchaseIn',
        component: () => import('@/views/purchase/in.vue'),
        meta: { title: '采购入库', perm: 'purchase:in' }
      }
    ]
  },
  {
    path: '/production',
    name: 'Production',
    meta: { title: '生产管理', icon: 'production', perm: 'production' },
    children: [
      {
        path: 'task',
        name: 'ProductionTask',
        component: () => import('@/views/production/task.vue'),
        meta: { title: '生产任务', perm: 'production:task' }
      },
      {
        path: 'outsource',
        name: 'ProductionOutsource',
        component: () => import('@/views/production/outsource.vue'),
        meta: { title: '委外任务', perm: 'production:outsource' }
      },
      {
        path: 'bom',
        name: 'ProductionBom',
        component: () => import('@/views/production/bom.vue'),
        meta: { title: 'BOM管理', perm: 'production:bom' }
      }
    ]
  },
  {
    path: '/retail',
    name: 'Retail',
    meta: { title: '零售管理', icon: 'retail', perm: 'retail' },
    children: [
      {
        path: 'index',
        name: 'RetailIndex',
        component: () => import('@/views/retail/index.vue'),
        meta: { title: '零售管理', perm: 'retail' }
      },
      {
        path: 'out',
        name: 'RetailOut',
        component: () => import('@/views/retail/out.vue'),
        meta: { title: '零售出库', perm: 'retail:out' }
      },
      {
        path: 'return',
        name: 'RetailReturn',
        component: () => import('@/views/retail/return.vue'),
        meta: { title: '零售退货', perm: 'retail:return' }
      }
    ]
  },
  {
    path: '/finance',
    name: 'Finance',
    meta: { title: '财务管理', icon: 'finance', perm: 'finance' },
    children: [
      {
        path: 'income',
        name: 'FinanceIncome',
        component: () => import('@/views/finance/income.vue'),
        meta: { title: '收入单', perm: 'finance:income' }
      },
      {
        path: 'expense',
        name: 'FinanceExpense',
        component: () => import('@/views/finance/expense.vue'),
        meta: { title: '支出单', perm: 'finance:expense' }
      },
      {
        path: 'receipt',
        name: 'FinanceReceipt',
        component: () => import('@/views/finance/receipt.vue'),
        meta: { title: '收款单', perm: 'finance:receipt' }
      },
      {
        path: 'payment',
        name: 'FinancePayment',
        component: () => import('@/views/finance/payment.vue'),
        meta: { title: '付款单', perm: 'finance:payment' }
      },
      {
        path: 'transfer',
        name: 'FinanceTransfer',
        component: () => import('@/views/finance/transfer.vue'),
        meta: { title: '转账单', perm: 'finance:transfer' }
      },
      {
        path: 'advance',
        name: 'FinanceAdvance',
        component: () => import('@/views/finance/advance.vue'),
        meta: { title: '收预付款', perm: 'finance:advance' }
      }
    ]
  },
  {
    path: '/report',
    name: 'Report',
    meta: { title: '报表查询', icon: 'report', perm: 'report' },
    children: [
      {
        path: 'inventory',
        name: 'ReportInventory',
        component: () => import('@/views/report/inventory.vue'),
        meta: { title: '商品库存', perm: 'report:inventory' }
      },
      {
        path: 'account',
        name: 'ReportAccount',
        component: () => import('@/views/report/account.vue'),
        meta: { title: '账户统计', perm: 'report:account' }
      },
      {
        path: 'retail',
        name: 'ReportRetail',
        component: () => import('@/views/report/retail.vue'),
        meta: { title: '零售统计', perm: 'report:retail' }
      },
      {
        path: 'purchase',
        name: 'ReportPurchase',
        component: () => import('@/views/report/purchase.vue'),
        meta: { title: '采购统计', perm: 'report:purchase' }
      },
      {
        path: 'sales',
        name: 'ReportSales',
        component: () => import('@/views/report/sales.vue'),
        meta: { title: '销售统计', perm: 'report:sales' }
      },
      {
        path: 'inbound-detail',
        name: 'ReportInboundDetail',
        component: () => import('@/views/report/inbound-detail.vue'),
        meta: { title: '入库明细', perm: 'report:inbound_detail' }
      },
      {
        path: 'outbound-detail',
        name: 'ReportOutboundDetail',
        component: () => import('@/views/report/outbound-detail.vue'),
        meta: { title: '出库明细', perm: 'report:outbound_detail' }
      },
      {
        path: 'transfer-detail',
        name: 'ReportTransferDetail',
        component: () => import('@/views/report/transfer-detail.vue'),
        meta: { title: '调拨明细', perm: 'report:transfer_detail' }
      },
      {
        path: 'inbound-summary',
        name: 'ReportInboundSummary',
        component: () => import('@/views/report/inbound-summary.vue'),
        meta: { title: '入库汇总', perm: 'report:inbound_summary' }
      },
      {
        path: 'outbound-summary',
        name: 'ReportOutboundSummary',
        component: () => import('@/views/report/outbound-summary.vue'),
        meta: { title: '出库汇总', perm: 'report:outbound_summary' }
      },
      {
        path: 'inventory-movement',
        name: 'ReportInventoryMovement',
        component: () => import('@/views/report/inventory-movement.vue'),
        meta: { title: '进销存统计', perm: 'report:inventory_movement' }
      },
      {
        path: 'customer-reconciliation',
        name: 'ReportCustomerReconciliation',
        component: () => import('@/views/report/customer-reconciliation.vue'),
        meta: { title: '客户对账', perm: 'report:customer_reconciliation' }
      },
      {
        path: 'supplier-reconciliation',
        name: 'ReportSupplierReconciliation',
        component: () => import('@/views/report/supplier-reconciliation.vue'),
        meta: { title: '供应商对账', perm: 'report:supplier_reconciliation' }
      },
      {
        path: 'inventory-warning',
        name: 'ReportInventoryWarning',
        component: () => import('@/views/report/inventory-warning.vue'),
        meta: { title: '库存预警', perm: 'report:inventory_warning' }
      }
    ]
  },
  {
    path: '/product',
    name: 'Product',
    meta: { title: '商品管理', icon: 'product', perm: 'product' },
    children: [
      {
        path: 'category',
        name: 'ProductCategory',
        component: () => import('@/views/product/category.vue'),
        meta: { title: '商品类别', perm: 'product:category' }
      },
      {
        path: 'info',
        name: 'ProductInfo',
        component: () => import('@/views/product/info.vue'),
        meta: { title: '商品信息', perm: 'product:info' }
      },
      {
        path: 'unit',
        name: 'ProductUnit',
        component: () => import('@/views/product/unit.vue'),
        meta: { title: '计量单位', perm: 'product:unit' }
      },
      {
        path: 'attribute',
        name: 'ProductAttribute',
        component: () => import('@/views/product/attribute.vue'),
        meta: { title: '多属性', perm: 'product:attribute' }
      },
      {
        path: 'barcode',
        name: 'ProductBarcode',
        component: () => import('@/views/product/barcode.vue'),
        meta: { title: '条码打印', perm: 'product:barcode' }
      }
    ]
  },
  {
    path: '/basic',
    name: 'Basic',
    meta: { title: '基本资料', icon: 'basic', perm: 'basic' },
    children: [
      {
        path: 'supplier',
        name: 'BasicSupplier',
        component: () => import('@/views/basic/supplier.vue'),
        meta: { title: '供应商信息', perm: 'basic:supplier' }
      },
      {
        path: 'customer',
        name: 'BasicCustomer',
        component: () => import('@/views/basic/customer.vue'),
        meta: { title: '客户信息', perm: 'basic:customer' }
      },
      {
        path: 'member',
        name: 'BasicMember',
        component: () => import('@/views/basic/member.vue'),
        meta: { title: '会员信息', perm: 'basic:member' }
      },
      {
        path: 'warehouse',
        name: 'BasicWarehouse',
        component: () => import('@/views/basic/warehouse.vue'),
        meta: { title: '仓库信息', perm: 'basic:warehouse' }
      },
      {
        path: 'income-expense',
        name: 'BasicIncomeExpense',
        component: () => import('@/views/basic/income-expense.vue'),
        meta: { title: '收支项目', perm: 'basic:income_expense' }
      },
      {
        path: 'settlement',
        name: 'BasicSettlement',
        component: () => import('@/views/basic/settlement.vue'),
        meta: { title: '结算账户', perm: 'basic:settlement' }
      },
      {
        path: 'handler',
        name: 'BasicHandler',
        component: () => import('@/views/basic/handler.vue'),
        meta: { title: '经手人管理', perm: 'basic:handler' }
      },
      {
        path: 'vehicle',
        name: 'BasicVehicle',
        component: () => import('@/views/basic/vehicle.vue'),
        meta: { title: '车辆管理', perm: 'basic:vehicle' }
      },
      {
        path: 'followup',
        name: 'BasicFollowup',
        component: () => import('@/views/basic/followup.vue'),
        meta: { title: '客户跟进', perm: 'basic:followup' }
      }
    ]
  },
  {
    path: '/system',
    name: 'System',
    meta: { title: '系统管理', icon: 'system', perm: 'system' },
    children: [
      {
        path: 'role',
        name: 'SystemRole',
        component: () => import('@/views/system/role.vue'),
        meta: { title: '角色管理', perm: 'system:role' }
      },
      {
        path: 'user',
        name: 'SystemUser',
        component: () => import('@/views/system/user.vue'),
        meta: { title: '用户管理', perm: 'system:user' }
      },
      {
        path: 'organization',
        name: 'SystemOrganization',
        component: () => import('@/views/system/organization.vue'),
        meta: { title: '机构管理', perm: 'system:organization' }
      },
      {
        path: 'log',
        name: 'SystemLog',
        component: () => import('@/views/system/log.vue'),
        meta: { title: '日志管理', perm: 'system:log' }
      },
      {
        path: 'config',
        name: 'SystemConfig',
        component: () => import('@/views/system/config.vue'),
        meta: { title: '系统配置', perm: 'system:config' }
      },
      {
        path: 'function',
        name: 'SystemFunction',
        component: () => import('@/views/system/function.vue'),
        meta: { title: '功能管理', perm: 'system:function' }
      },
      {
        path: 'tenant',
        name: 'SystemTenant',
        component: () => import('@/views/system/tenant.vue'),
        meta: { title: '租户管理', perm: 'system:tenant' }
      },
      {
        path: 'product-attribute',
        name: 'SystemProductAttribute',
        component: () => import('@/views/system/product-attribute.vue'),
        meta: { title: '商品属性', perm: 'system:product_attribute' }
      },
      {
        path: 'plugin',
        name: 'SystemPlugin',
        component: () => import('@/views/system/plugin.vue'),
        meta: { title: '插件管理', perm: 'system:plugin' }
      },
      {
        path: 'platform',
        name: 'SystemPlatform',
        component: () => import('@/views/system/platform.vue'),
        meta: { title: '平台配置', perm: 'system:platform' }
      }
    ]
  },
  {
    path: '/profile',
    name: 'Profile',
    component: () => import('@/views/profile/index.vue'),
    meta: { title: '个人信息', hidden: true }
  },
  {
    path: '/403',
    name: 'NoAuth',
    component: () => import('@/views/error/403.vue'),
    meta: { title: '无权限', hidden: true }
  }
]

export default erpRoutes 